#ifndef POKI_H
#define POKI_H

#include "common.h"

#include "app/album/album.h"
#include "app/wlan/wlan.h"
#include "app/setting/setting.h"
#include "app/weather/weather.h"
#include "app/clock/clock.h"
#include "app/hotspot/hotspot.h"
#include "app/holoserver/holoserver.h"
#include "app/video/video.h"
#include "app/file_system/file_system.h"
#include "app/example/example.h"

#include "hardware.h"


# define APP_NUM 9//app数量需要修改

#define APP0 Clock
#define APP1 Album
#define APP2 Video
#define APP3 Weather
#define APP4 Wlan
#define APP5 Hotspot
#define APP6 Setting
#define APP7 HoloServer
#define APP8 FileSystem
//undeveloped app
#define APP9 Example
#define APP10 Example
#define APP11 Example
#define APP12 Example

class Poki
{
  private:
  // ICON SET;
  lv_img_dsc_t app_icon[APP_NUM] = {clock_icon, album_icon, video_icon, weather_icon, wlan_icon, hotspot_icon, setting_icon, server_icon, file_icon};//图标需要修改
  // const char* app_name[APP_NUM] = {"Clock", "Album", "Video", "Weather", "Wifi", "Hotspot", "Setting", "FTPServer", "FileSystem"};//app名称需要修改
  const char* app_name[APP_NUM] = {"时钟", "相册", "视频", "天气", "无线", "热点", "设置", "文件", "终端"};//app名称需要修改
  //app member
  int app_num=APP_NUM;
  APP0 *app0;
  APP1 *app1;
  APP2 *app2;
  APP3 *app3;
  APP4 *app4;
  APP5 *app5;
  APP6 *app6;
  APP7 *app7;
  APP8 *app8;
  APP9 *app9;
  APP10 *app10;
  APP11 *app11;
  APP12 *app12;

  //app for os
  Wlan *wlan;
  //gui_element
  lv_style_t font_style;
  lv_style_t font_style_app;
  lv_obj_t *app_scr;
  lv_obj_t *now_app_icon, *now_app_label;
  lv_obj_t *next_app_icon, *next_app_label;
  Preferences save_cfg;

  //app_menu
  
  void main_menu();
  void setup_app();
  void kill_app();
  void run_app();
  long timecal;
  int now_app=0;
  bool is_running_app=false;
  Action cur_act=NOACT;
  bool name_hidden=false;
  long name_hidden_time;
  uint32_t duration = lv_anim_speed_to_time(200, 3.14/2*100, 0);
  lv_anim_path_t path;

  Event cur_event=NOEVENT;
  public:
  Poki();
  Event main_process(Action);
  void setup_ani(Hardware*);
};

#endif




